import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";

const routes: Array<RouteRecordRaw> = [
  {
    path: "/",
    redirect: "/terminal",
  },
  {
    path: "/home",
    name: "Home",
    component: () => import("../views/Home.vue"),
    children: [
      {
        path: "/subjective-evaluation-system",
        name: "SubjectiveEvaluation",
        component: () =>
          import("../views/SubjectiveEvaluationSystem/Index.vue"),
        children: [
          {
            path: "/template",
            name: "Template",
            component: () =>
              import("../views/SubjectiveEvaluationSystem/Template.vue"),
          },
          {
            path: "/evaluateTask",
            name: "EvaluateTask",
            component: () =>
              import("../views/SubjectiveEvaluationSystem/EvaluateTask.vue"),
          },
          {
            path: "/recordBack",
            name: "RecordBack",
            component: () =>
              import("../views/SubjectiveEvaluationSystem/RecordBack.vue"),
          },
        ],
      },
      // 汇聚系统
      {
        path: "/convergence-system",
        name: "ConvergenceSystem",
        component: () => import("../views/ConvergenceSystem/Index.vue"),
        children: [
          {
            path: "/live",
            name: "LiveResource",
            component: () =>
              import("../views/ConvergenceSystem/LiveResource.vue"),
          },
          {
            path: "/terminal",
            name: "TerminalResource",
            component: () =>
              import("../views/ConvergenceSystem/TerminalResource.vue"),
          },
          {
            path: "/vod",
            name: "VodResource",
            component: () =>
              import("../views/ConvergenceSystem/VodResource.vue"),
          },
        ],
      },
    ],
  },
  {
    path: "/expert-evaluate",
    name: "ExpertEvaluate",
    component: () => import("../views/ExpertEvaluate.vue"),
  },
  {
    path: "/system-manage",
    name: "SystemManage",
    component: () => import("../views/SystemManage/Index.vue"),
    children: [
      {
        path: "/user-manage",
        name: "UserManage",
        component: () => import("../views/SystemManage/UserManage.vue"),
      },
      {
        path: "/role-manage",
        name: "RoleManage",
        component: () => import("../views/SystemManage/RoleManage.vue"),
      },
    ],
  },
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
